package com.jf.listener;

import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.annotation.WebListener;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-09-02
 * Time:0:17
 */
@WebListener
public class JFServletRequestAttributeListener implements ServletRequestAttributeListener {
    @Override
    public void attributeAdded(ServletRequestAttributeEvent servletRequestAttributeEvent) {
        System.out.println("===================================================================================");
        System.out.println("request add " + servletRequestAttributeEvent.getName() + " - " + servletRequestAttributeEvent.getValue());
        System.out.println("===================================================================================");
    }

    @Override
    public void attributeRemoved(ServletRequestAttributeEvent servletRequestAttributeEvent) {
        System.out.println("===================================================================================");
        System.out.println("request remove " + servletRequestAttributeEvent.getName() + " - " + servletRequestAttributeEvent.getValue());
        System.out.println("===================================================================================");
    }

    @Override
    public void attributeReplaced(ServletRequestAttributeEvent servletRequestAttributeEvent) {
        System.out.println("===================================================================================");
        System.out.println("request replaced " + servletRequestAttributeEvent.getName() + " - " + servletRequestAttributeEvent.getValue());
        System.out.println("===================================================================================");
    }
}
